package com.wyg.epdata.controller;


import com.wyg.epdata.service.ArticleEntityService;
import com.wyg.epdata.service.ArticleKwService;
import com.wyg.epcommonbase.common.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author WangYongGan
 * @since 2021-11-11
 */
@RestController
@RequestMapping("/articleKw")
@Api(tags = "文章关键字")
public class ArticleKwController {
    @Autowired
    ArticleEntityService articleEntityService;
    @Autowired
    ArticleKwService baseService;

    @ApiOperation("获取的企业前n关键字")
    @PostMapping("/getNKwByEntity")
    public ApiResult getKwByCompanyName(@RequestParam String entity, @RequestParam int n) {
        return ApiResult.ok().data(baseService.getNKwByEntity(entity, n));
    }

    @ApiOperation("获所有前n关键字")
    @PostMapping("/getNKw")
    public ApiResult getNKw(@RequestParam int n) {
        return ApiResult.ok().data(baseService.getNKw(n));
    }

}

